package com.zuxia.controller;

import com.zuxia.dto.after.AftersalesinfoDto;
import com.zuxia.dto.commission.CommissionDto;
import com.zuxia.entity.MyPageDto;
import com.zuxia.service.CommissionService;
import com.zuxia.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author laoli
 * @since 2024-11-19
 */
@RestController
@RequestMapping("/user/commission")
public class CommissionController {
    @Resource
    private CommissionService commissionService;

    @ApiOperation("待入账的钱")
    @PostMapping("/entry")
    public R getEntry(){
        CommissionDto notEntry = commissionService.getNotEntry();
        return R.ok().message("待入账的钱").data("commission-entry",notEntry);
    }

    @ApiOperation("入账")
    @GetMapping("/getCommission/{commissionId}")
    public R getCommissionId(@PathVariable("commissionId")String commissionId){
        commissionService.Entry(commissionId);
        return R.ok().message("入账成功，前往收支表查");
    }
}
